var axios =require("axios");

var ConfigurationService={
       FindProjects(){

	       return axios.get('/services/ConfigurationService/FindProjects')
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindProjects', err) })
       },
	
	
	   FindProjectVersionsByProject(projectId){

	       return axios.get('/services/ConfigurationService/FindProjectVersionsByProject?projectId='+projectId)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindProjectVersionsByProject', err) })
       },
	
	
	   FindFlowsInProject(projectVersionId ,istest){
           var params = new URLSearchParams();
           params.append('projectVersionId',projectVersionId);
           params.append('test',istest);
	       return axios.post("/services/ConfigurationService/FindFlowsInProject",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindFlowsInProject', err) })
       },
	
	
	   FindModelsInProject(projectVersionId ){
           var params = new URLSearchParams();
           params.append('projectVersionId',projectVersionId);
	       return axios.post("/services/ConfigurationService/FindModelsInProject",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindModelsInProject', err) })
       },
	
	
	   FindResourcesInProject(projectVersionId ){
           var params = new URLSearchParams();
           params.append('projectVersionId',projectVersionId);
	       return axios.post("/services/ConfigurationService/FindResourcesInProject",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindResourcesInProject', err) })
       },
	FindProjectDependencies(projectVersionId ){
           var params = new URLSearchParams();
           params.append('projectVersionId',projectVersionId);
	       return axios.post("/services/ConfigurationService/FindProjectDependencies",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindProjectDependencies', err) })
       },
	
	FindResource(id ){
           var params = new URLSearchParams();
           params.append('id',id);
	       return axios.post("/services/ConfigurationService/FindResource",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindResource', err) })
       },
	
	FindResourceDefinition(id ){
           var params = new URLSearchParams();
           params.append('id',id);
	       return axios.post("/services/ConfigurationService/FindResourceDefinition",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindResource', err) })
       },
	
	FindResourceSettting(id ){
           var params = new URLSearchParams();
           params.append('id',id);
	       return axios.post("/services/ConfigurationService/FindResourceSettting",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindResourceSettting', err) })
       },
	
	SaveResourceSettings(data ){
           var params = new URLSearchParams();
           params.append('data',JSON.stringify(data));
	       return axios.post("/services/ConfigurationService/SaveResourceSettings",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in SaveResourceSettings', err) })
       },
	
	FindModel(id ){
           var params = new URLSearchParams();
           params.append('id',id);
	       return axios.post("/services/ConfigurationService/FindModel",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindModel', err) })
       },
	
	FindComponent(componentId,readRelations ){
           var params = new URLSearchParams();
           params.append('componentId',componentId);
		   params.append('readRelations',readRelations);
	       return axios.post("/services/ConfigurationService/FindComponent",params)
           .then(function (data) {
               return data.data;
           })
      .    catch(function (err) { console.warn('Error in FindComponent', err) })
       }
};

export {
	ConfigurationService
}